<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<%@include file="/views/common/include/taglib.jsp"%>
<%@include file="/views/common/include/head.jsp"%>
<link rel="stylesheet" href="${ctx}/css/page/header2.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/reset.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/shangchennav.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/footer.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/gwc.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/page.css" type="text/css">
<script src="${ctx}/js/controllers/mall/shopcartController.js" type="text/javascript"></script>
<style type="text/css">
</style>
</head>
<body>
<script type="text/javascript">
    var ctx = '${ctx}';
    setCtx(ctx);
    function searchGoodsOrShops(){
		var selectType = $("#selectType").val();
		var name = $("#name").val();
		window.location.href = ctx +"/searchGoodsOrShops?pNo=1" + "&selectType=" +selectType +"&name=" + name;
	}
</script>
    <jsp:include page="/views/common/head_main.jsp" />
    <div class="bg">
    <input type="hidden" id="item" value="${sessionScope.item_mall}"/>
        <div class="contentbox1 contentbox">
            <div class="nav">
                 <ul>
                    <li><a href="${ctx}/main?item=4">商城首页</a></li><span>|</span>
                    <li><a href="${ctx}/mallSeckill">秒杀专区</a></li><span>|</span>
                    <li><a href="${ctx}/main?item=4#article">精品推荐</a></li><span>|</span>
                    <li><a href="${ctx}/main?item=4#hotshop">热门商铺</a></li><span>|</span>
                    <li><a href="${ctx}/mallIntegral">积分专区</a></li>
                </ul>
               <div class="seabox">
					<select class="searchhh" id="selectType">
					<option value="1">商品</option>
					<option value="2">店铺</option>
					</select>
					<input class="search" type="text" id="name"></input><button class="searchbtn" onclick="searchGoodsOrShops()">搜索</button>
				</div>
                <div class="cartbox">
                     <img src="${ctx}/images/mall/cart.png">&nbsp;&nbsp;&nbsp;<a href="${ctx}/shopcart/shopcartList" target="_blank">我的购物车</a>
                </div>
            </div>
        </div>
        <div class="contentbox2 contentbox">
        
            <div class="padd">
                <div class="cart-head">
                    <div class="cart-jdt">
                        <span class="cart-title">我的购物车</span> <img
                            src="${ctx}/images/gwc/jd.png">
                    </div>
                    <p class="cart-all-item">全部商品</p>
                </div>
                <c:if test="${not empty shopcart}">
                <div class="cart-main">
                    <div class="cart-table-th">
                        <div class="wp">
                            <div class="th th-check">
                                <input class="check-shop-all"
                                    type="checkbox" name="all_checkbox">
                                &nbsp;&nbsp;全选
                            </div>
                            <div class="th th-item">商品信息</div>
                            <div class="th th-price">单价</div>
                            <div class="th th-amount">数量</div>
                            <div class="th th-op">操作</div>
                        </div>
                    </div>
                    <input id="changeBeforeValue" type="hidden" value="">
                    <input id="changeBeforeId" type="hidden" value="">
                    <c:forEach items="${shopcart}" var="shopcartVo" varStatus="shopcartStatus">
                        <div class="order-list">
                            <div style="height: auto">
                                <div class="order-body">
                                    <div class="shop-info">
                                        <div class="padd2">
                                            <input class="oneshop-all"
                                                type="checkbox" name="checkShop" id="${shopcartVo.shopId}">
                                            <a href="${ctx}/shopIndex?pNo=1&shopId=${shopcartVo.shopId}&shopName=${shopcartVo.shopName}" class="shop-name"><img
                                                src="${ctx}/images/gwc/shop2.png">${shopcartVo.shopName}
                                                &nbsp;&nbsp;&nbsp;></a> <a
                                                href="javascript:getCoupons('领券','${ctx}/shopcart/getCoupons?shopId='+${shopcartVo.shopId})" class="ticket">领券</a>
                                        </div>
                                    </div>
                                    <div class="order-content" id="order-content_${shopcartVo.shopId}">
                                        <c:forEach  items="${shopcartVo.goodsList}" var="goods" varStatus="goodsStatus">
                                            <div class="one-order">
                                                <div class="padd3">
                                                    <ul class="over-flow">
                                                        <li class="td td-check"><input
                                                            class="one-item"
                                                            type="checkbox"
                                                            id="${goods.id}_${goods.price}_${goods.amount}"
                                                            name="item_checkbox"></li>
                                                        <li class="td td-item">
                                                            <div class="item-pic">
                                                            <img width="70px" height="70px" src="${sessionScope.image_logo}${goods.goodsLogo}" />
<%--                                                                 ${goods.goodsLogo}<img src="${ctx}/images/gwc/item-pic.png" /> --%>
                                                            </div>
                                                            <div class="item-info">
                                                                <a href="" class="item-name">${goods.goodsName}</a>
                                                                <p class="item-spc">${goods.memo}</p>
                                                            </div>
                                                        </li>
                                                        <li class="td td-price">
                                                            <span class="price-now">￥${goods.price}</span>
                                                        </li>
                                                        <li class="td td-amount">
                                                            <div class="amount">
                                                                <a class="decrement" id="${goods.id}_${goods.goodsId}_0" href="javascript:void(0);">-</a>
                                                                    <input class="stock-num"  id="${goods.id}_${goods.goodsId}_${goods.amount}_${goods.price}" value="${goods.amount}"></input>
                                                                <a class="increment" id="${goods.id}_${goods.goodsId}_1" href="javascript:void(0);">+</a>
                                                            </div>
                                                        </li>
                                                        <li class="td td-op">
                                                            <p><a href="javascript:addMyFavorite('${goods.id}', '${goods.goodsId}');">移入收藏</a></p>
                                                            <p><a href="javascript:deleteShopcart('${goods.id}');">删除商品</a></p>
                                                        </li>
                                                    </ul>
                                                </div>
        
                                            </div>
                                        </c:forEach>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </div>

                <div class="pay">
                    <input type="checkbox" class="s-all" name="all_checkbox"> 全选
                    <div class="paybox">
                        <input type="hidden" id="hiddenTotalPrice" value="0.00"/>
                        <span>已选商品（不含运费）<span class="total-price" id="totalPrice" >￥0.00</span></span>
                        <button class="pay-btn">结算</button>
                </div>
                </div>
                </c:if>
                <c:if test="${empty shopcart}">
	                <div  style="padding: 20px 0;line-height:180px;text-align: center;">
	                       <img style="vertical-align: -22px;" src="${ctx}/images/page/pe7.png"><span class="notext">您的购物车暂时没有商品，去逛逛吧 !</span>
	                 </div>
                </c:if>
                <div class="item-description" style="margin-top: 60px;">
						<div style="padding: 10px;font-size: 16px;">最近浏览</div>
						<div class="pic-wrap">
							<c:forEach items="${goodsReads}" var="item" varStatus="status">
								<div style="padding:20px 40px 60px 40px; float:left;">
									<div>
									<a href="${ctx}/GoodsDetail?id=${item.goodsId}" target="_blank">
									<img alt="" width="140" height="140" src="${sessionScope.image_logo}${item.logo}"/>
									</a>
									</div>
									<%-- <div >
										<span style="background-color: #FEAB69;margin-left:30px;border-radius:5px;padding:5px 12px;color:#fff;cursor: pointer;">
								    			<a href="${ctx}/GoodsDetail?id=${item.goodsId}" target="_blank">立即抢购</a></span>
										<!-- <span style="border:1px solid #ddd;color:#9A9A9A;font-size: 10px;padding: 3px 5px;border-radius:3px;float: right;">立即购买</span> -->
									</div> --%>
								</div>
							</c:forEach>
						</div>
					</div>
                </div>
            </div>
        </div>
    <jsp:include page="/views/common/footer.jsp" />
</body>
</html>